package com.example.kafkalistenernew;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.annotation.KafkaListeners;

/**
 * @Description:
 * @Author: xieguangda
 * @Date: 2021年06月30日 17:09
 */
public class KafkaConsumer {

    @KafkaListeners({@KafkaListener(topics="kafkastudy")})
    public void listen(ConsumerRecord<Integer, Message> msg) {
        // 消费到数据后的处理逻辑
        System.out.println("我被消费了l::::;" + msg.value());
    }

    //@KafkaListener({@KafkaListener(topics="kafkadelaystudy")})
    @KafkaListener(topics = "kafkadelaystudy")
    public void listenDely(ConsumerRecord<Integer, Message> msg) {
        // 消费到数据后的处理逻辑
        System.out.println("延迟队列我被消费了l::::;" + msg.value());
    }

}